package it.fuesi.synotools.services.client;

import it.fuesi.synotools.model.base.VoidResponse;
import it.fuesi.synotools.model.download.DownloadStationConfigResponse;
import it.fuesi.synotools.model.download.DownloadStationInfoResponse;
import it.fuesi.synotools.model.download.DownloadTasksListResponse;
import it.fuesi.synotools.services.constants.Service;
import it.fuesi.synotools.services.constants.ServiceType;
import retrofit.http.EncodedQuery;
import retrofit.http.Field;
import retrofit.http.FormUrlEncoded;
import retrofit.http.GET;
import retrofit.http.POST;
import retrofit.http.Query;

/**
 * Created by pascotto on 16/10/14.
 */
@ServiceType(Service.Synology)
public interface DownloadStationClient {

    /*
    @GET("/webapi/DownloadStation/task.cgi?api=SYNO.DownloadStation.Task&version=1&method=list&additional=transfer")
    DownloadTasksListResponse listTasks(@Query("sid") String sid);
*/

    @GET("/webapi/DownloadStation/statistic.cgi?api=SYNO.DownloadStation.Statistic&version=1&method=getinfo")
    DownloadStationInfoResponse info();

    @GET("/webapi/DownloadStation/info.cgi?api=SYNO.DownloadStation.Info&version=1&method=getconfig")
    DownloadStationConfigResponse getConfig();

    @GET("/webapi/DownloadStation/task.cgi?api=SYNO.DownloadStation.Task&version=1&method=list&additional=transfer")
    DownloadTasksListResponse listTasks();

    @GET("/webapi/DownloadStation/task.cgi?api=SYNO.DownloadStation.Task&version=1&method=create")
    VoidResponse createTask(@EncodedQuery("uri") String uri);

    @GET("/webapi/DownloadStation/task.cgi?api=SYNO.DownloadStation.Task&version=1&method=delete")
    VoidResponse deleteTask(@Query("id") String id);

    @GET("/webapi/DownloadStation/task.cgi?api=SYNO.DownloadStation.Task&version=1&method=pause")
    VoidResponse pause(@Query("id") String id);

    @GET("/webapi/DownloadStation/task.cgi?api=SYNO.DownloadStation.Task&version=1&method=resume")
    VoidResponse resume(@Query("id") String id);

    @POST("/webman/3rdparty/DownloadStation/aMuleUI/search.cgi")
    @FormUrlEncoded
    VoidResponse createEmuleTask(@Field("action") String download, @Field("IDList") String IDList);



}
